package com.hifar.test.api.model;

/**
 * 响应状态枚举
 */
public enum ResponseStatus {
    
    /**
     * 成功
     */
    SUCCESS(1),
    
    /**
     * 失败
     */
    FAILURE(-1);
    
    private final Integer value;
    
    ResponseStatus(Integer value) {
        this.value = value;
    }
    
    public Integer getValue() {
        return value;
    }
    
    public static ResponseStatus fromValue(Integer value) {
        for (ResponseStatus status : ResponseStatus.values()) {
            if (status.getValue().equals(value)) {
                return status;
            }
        }
        throw new IllegalArgumentException("Unknown response status: " + value);
    }
}
